package com.atguigu.yygh.mq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @description:
 * @author :又菜又爱玩的→速趴塞亚锦←
 * @create :2023/5/20
 * @param  :1.8
 */
@Component
public class RabbitService {

   @Resource
    private RabbitTemplate rabbitTemplate;

   public boolean sendMessage(String exchange,String routingkey,Object message){
       rabbitTemplate.convertAndSend(exchange,routingkey,message);
       return true;
   }
}
